#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int flag[3300];
char s[3300];
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n,sum = 0,sign = 0,kk = 0;
		cin>>n;
		cin>>s;
		for(int i = 0;i<n;i++)
		{
			
			int x = s[i]-'0';
			if(i==0) flag[i] = x;
			else flag[i] = flag[i-1]+x;
			if(x%2) sign = 1;
			sum += x;
		}
		if(!sign) printf("-1\n");
		//else if(sum%2==)
		else 
		{
			for(int i = n-1;i>=0;i--)
			{
				int m = s[i]-'0';
				if(m%2==1)
				{
					if(flag[i]%2==0)
					{
						for(int j = 0;j<=i;j++)
						{
							if(s[j]!='0') cout<<s[j];
						}
						break;
					}
					else 
					{
					//	printf("******\n");
						int z = -1;
						for(int j = 0;j<i;j++)
						{
							int y = s[j]-'0';
							if(y%2==1)
							{
								z = j;
								break;
							}
						}
						if(z!=-1)
						{
							for(int j = 0;j<=i;j++)
							{
								if(j!=z&&s[j]!='0') cout<<s[j];
							}
						}
						else cout<<"-1";
						break;
					}
				}
			}
			cout<<endl;
		}
	}
} 
